package com.apimarket.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import javax.validation.constraints.NotNull;
import java.util.Date;

/**
 * api集实体类
 *
 * @author yyc
 */
@Data
public class ApiSet {
    //@NotNull(message = "接口集id不能为空")
    private String id;

    @NotNull(message = "接口集名不能为空")
    private String name;

    //转为英文后的名字，主要用于kong中service
    //private String englishName;

    @NotNull(message = "接口集所属类型不能为空")
    private Integer type=0;

    private String userId;

    //@NotNull(message = "日期不能为空")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date date;

    @NotNull(message = "接口集描述不能为空")
    private String description;

    private String picUrl;//接口集的图片地址

    private String orignName;//图片原来的名字

    private Double price;//接口集的价格
    /**
     * 统一提交需要url字段
     */
    private String url;

    /*public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Integer getType() {
        return type;
    }

    public void setType(Integer type) {
        this.type = type;
    }

    public String getUserId() {
        return userId;
    }

    public void setUserId(String userId) {
        this.userId = userId;
    }

    public Date getDate() {
        return date;
    }

    public void setDate(Date date) {
        this.date = date;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    @Override
    public String toString() {
        final StringBuilder sb = new StringBuilder("ApiSet{");
        sb.append("id='").append(id).append('\'');
        sb.append(", name='").append(name).append('\'');
        sb.append(", type=").append(type);
        sb.append(", userId='").append(userId).append('\'');
        sb.append(", date=").append(date);
        sb.append(", description='").append(description).append('\'');
        sb.append(", url='").append(url).append('\'');
        sb.append('}');
        return sb.toString();
    }*/
}